package com.evan.designpatterns.singleton.lazy;

/**
 * @author :liujiapeng01
 * @date :2019-03-13 12:21
 **/
public class InnerClassLazySingleton {


    private InnerClassLazySingleton() {
        if (InnerClass.SINGLETON != null) {
            throw new RuntimeException("无权限");
        }

    }


    public static final InnerClassLazySingleton getInstance() {
        return InnerClass.SINGLETON;
    }


    private static class InnerClass {
        private static final InnerClassLazySingleton SINGLETON = new InnerClassLazySingleton();
    }
}
